<!-- pass a variable to included page -->
<%@ page import="SSP.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<% 
   String today = null;
   Today t = new Today();
   today = t.getToday();
   request.setAttribute("picture","Dispatcher");
   request.setAttribute("title", "Open Service Order Requests");  
   request.setAttribute("header", "Welcome : Today is " + today); 
   String equipment ="";
  equipment=session.getAttribute("equipmentid")+"";
 %>
 <%@ include file="header.jsp"%>
<TD width="850" vAlign="top"> 

<br /><h2>Equipment Details</h2><br />		


<%String myQuery = "select so.serviceorderid, c.customername, e.equipmentid, l.address1, l.city, l.state, l.zip, "+
"sos.sostatusdescription, st.servicetypedescription, p.prioritydescription, so.problemdescription "+
"from serviceorder so, customer c, equipment e, location l, serviceorderstatus sos, servicetype st, priority p "+
"where so.customerid = c.customerid and e.equipmentid = so.equipmentid and so.locationid = l.locationid and so.sostatusid = sos.sostatusid "+
"and st.servicetypeid = so.servicetypeid and p.priorityid = so.priorityid and so.equipmentid = ?";

        
        System.out.println(myQuery);

OraDB myDB = new OraDB();
ResultSet rs = null;
myDB.createConnection();
rs=myDB.Query(myQuery); 
String equipmenthistory="";

%>
  <tr>
		<th bgcolor="#3B73B9" style="color:white;">Service Order ID</th> 
		<th bgcolor="#3B73B9" style="color:white;">Customer Name</th>
		<th bgcolor="#3B73B9" style="color:white;">Address</th>
		<th bgcolor="#3B73B9" style="color:white;">City</th>
		<th bgcolor="#3B73B9" style="color:white;">State</th>
		<th bgcolor="#3B73B9" style="color:white;">Zip</th>
		<th bgcolor="#3B73B9" style="color:white;">Status</th>
		<th bgcolor="#3B73B9" style="color:white;">Priority</th>
		<th bgcolor="#3B73B9" style="color:white;">Problem Description</th>
		
		</tr>
	  
<%  while (rs.next()) {   
	if (equipmenthistory.equals(rs.getString("equipmentid"))) {
	} else { 
		equipmenthistory = rs.getString("equipmentid");%>
		
<%	} %>

        <tr>
		<!-- <td><a href="dispatcherassign.jsp?serviceorderid=<%=rs.getString("serviceorderid")%>"><%=rs.getString("serviceorderid")%></a></td>-->
		
		<td><%=rs.getString("serviceorderid")%></td>
		<td><%=rs.getString("customername")%></td>
		<td><%=rs.getString("equipmentid")%></td>
		<td><%=rs.getString("address1")%></td>
		<td><%=rs.getString("city")%></td>
		<td><%=rs.getString("state")%></td>
		<td><%=rs.getString("zip")%></td>
		<td><%=rs.getString("sostatusdescription")%></td>
		<td><%=rs.getString("servicetypedescription")%></td>
		<td><%=rs.getString("prioritydescription")%></td>
		<td><%=rs.getString("problemdescription")%></td>


		</tr>
 <%  } %>
</table>
<%
rs.close();
myDB.closeConnection();
%> 